package Pet.Management.domain.entity;

import jakarta.persistence.*;
import lombok.Data;
import java.time.LocalDateTime;

@Data
@Entity
@Table(name = "sys_captcha")
public class Captcha {
    @Id
    private String uuid;
    
    @Column(nullable = false)
    private String code;
    
    @Column(name = "expire_time", nullable = false)
    private LocalDateTime expireTime;
    
    @Column(name = "create_time", nullable = false)
    private LocalDateTime createTime;
    
    @PrePersist
    protected void onCreate() {
        createTime = LocalDateTime.now();
        expireTime = createTime.plusMinutes(2); // 验证码2分钟有效
    }
} 